var ahi = {
    observerService: null,
    
    init: function () {
        gSanitizePromptDialog.oldSanitize = gSanitizePromptDialog.sanitize;
        gSanitizePromptDialog.sanitize = function() {
            ahi.preSanitize();
            gSanitizePromptDialog.oldSanitize();
            ahi.postSanitize();
        };
        this.observerService = Components.classes['@mozilla.org/observer-service;1']
                                .getService(Components.interfaces.nsIObserverService);
    },
    preSanitize: function () {
        this.observerService.notifyObservers(null, 'cookie-changed', 'sanitize-pre');
    },
    
    postSanitize: function () {
        this.observerService.notifyObservers(null, 'cookie-changed', 'sanitize-post');
    }
};
ahi.init();